import { request } from "@/utils/service"
import type * as TB from "./types/tb"
// import { getToken } from "@/utils/cache/cookies"
// import axios from "axios"
// const baseURL = import.meta.env.VITE_BASE_API
/** -----------------------------E N D------------------------------------ */
/**订单相关接口 */

export function getTbListDataApi(params: TB.IGetDyRequestData) {
  return request<any>({
    url: "/capture/tm/queryPage",
    method: "get",
    params
  })
}
//之前号卡之家接口
// export function getTbListDataApi2(params: any) {
//   return request<any>({
//     url: "/tmall/queryPage",
//     method: "get",
//     params
//   })
// }
export function getTbListDataApi2(params: any) {
  return request<any>({
    url: "/order/tm/queryPage",
    method: "get",
    params
  })
}

/**前置校验相关 */

/**新增 */

export function createTbForntApi(data: TB.ICreateTbFronttData) {
  return request({
    url: "order/packageTb/add ",
    method: "post",
    data
  })
}

/** 删 */
export function deleteTbFrontDataApi(id: string) {
  return request({
    url: "order/packageTb/del",
    method: "delete",
    params: {
      id
    }
  })
}

/** 改 */
export function updateTbFrontDataApi(data: TB.ICreateTbFronttData) {
  return request({
    url: "order/packageTb/update",
    method: "put",
    data
  })
}

/** 查 */
export function getTbFrontDataApi(params: TB.IGetTbFrontRequestData) {
  return request<TB.IGetTbFrontRequestData>({
    url: "order/packageTb/query",
    method: "get",
    params
  })
}

/**店铺配置 */
/** 增 */
export function createTbDataApi(data: TB.ICreateTbShopData) {
  return request<any>({
    url: "order/tbShop/add",
    method: "post",
    data
  })
}

/** 删 */
export function deleteTbDataApi(id: string) {
  return request({
    url: "order/tbShop/del",
    method: "delete",
    params: {
      id
    }
  })
}

/** 改 */
export function updateTbDataApi(data: TB.ICreateTbShopData) {
  return request<any>({
    url: "order/tbShop/update",
    method: "put",
    data
  })
}

/** 查 */
export function getTbDataApi(params: TB.IGetTbShopRequestData) {
  return request<any>({
    url: "order/tbShop/query",
    method: "get",
    params
  })
}
// 身份证查询id
export function gettmqueryCardAPi(params: any) {
  return request<any>({
    url: "/capture/tm/queryCard",
    method: "get",
    params
  })
}

/**根据订单ID查询详情 */

export function getDetailsInfo(params: any) {
  return request<any>({
    url: "/capture/tm/queryOrder",
    method: "get",
    params
  })
}
/**根据订单ID查询详情 */

export function getTmReceivingInfo(params: any) {
  return request<any>({
    url: "/capture/tm/decryptOne",
    method: "get",
    params
  })
}

/**改变旗帜颜色 */

export function changeColor(params: any) {
  return request<any>({
    url: "/capture/tm/updateMemo",
    method: "get",
    params
  })
}

// 批量修改提交
export function updateCaptureIDS(data: any) {
  return request({
    url: "/order/tm/submit",
    method: "put",
    data: data
  })
}
/**店铺配置 */
/** 是否关闭解密 */
export function isCloseOrOpen(data: any) {
  return request<any>({
    url: "/order/tbShop/updateOffs",
    method: "post",
    data
  })
}
